<!DOCTYPE HTML>
<html>
    <head>
        <!-- meta -->
        <!-- meta -->
        <title>Row template</title>
        <!-- css -->
        <link href="../styles/examples.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.common.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.kendo.css" rel="stylesheet"/>
        <!-- css -->
        <!-- script -->
        <script src="../js/jquery.js"></script>
        <script src="../../source/js/kendo.core.js"></script>
        <script src="../../source/js/kendo.data.odata.js"></script>
        <script src="../../source/js/kendo.data.js"></script>
        <script src="../../source/js/kendo.popup.js"></script>
        <script src="../../source/js/kendo.list.js"></script>
        <script src="../../source/js/kendo.dropdownlist.js"></script>
        <script src="../../source/js/kendo.grid.js"></script>
        <!-- script -->
    </head>
    <body>
        <!-- nav -->
        <!-- nav -->
        <!-- description -->
        <div class="description"></div>
        <!-- description -->
        <div id="example" class="k-content">
            <table id="netflixTable">
                <thead>
                    <tr>
                        <th>
                            Cover
                        </th>
                        <th>
                            Title
                        </th>
                        <th>
                            Rating
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td colspan="3"></td>
                    </tr>
                </tbody>
            </table>
           <script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                        <img src="${ BoxArt.SmallUrl }" alt="${ Name }" />
                    </td>
                    <td>
                        ${ Name }
                    </td>
                    <td>
                        ${ AverageRating }
                    </td>
                </tr>
            </script>
            <script>
                $(document).ready(function() {
                    $("#netflixTable").kendoGrid({
                        dataSource: {
                            type: "odata",
                            serverFiltering: true,
                            filter: [{
                                field: "Name",
                                operator: "contains",
                                value: "Star Wars"
                                },{
                                field: "BoxArt.SmallUrl",
                                operator: "neq",
                                value: null
                            }],
                            transport: {
                                read: "http://odata.netflix.com/Catalog/Titles"
                            }
                        },
                        rowTemplate: kendo.template($("#rowTemplate").html()),
                        height: 200
                    });
                });
            </script>
        </div>
        <!-- tools -->
        <!-- tools -->
    </body>
</html>
